cmake_minimum_required(VERSION 3.0)
project(mRender)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")

set(DIR_INCLUDES "${PROJECT_SOURCE_DIR}/include")

## copy files
file(COPY shaders DESTINATION ./)
file(COPY models DESTINATION ./)
file(COPY lib/glfw3.dll DESTINATION ./)

## Imgui
add_library(imgui STATIC
        ${DIR_INCLUDES}/imgui/imgui.cpp
        ${DIR_INCLUDES}/imgui/imgui_impl_glfw.cpp
        ${DIR_INCLUDES}/imgui/imgui_impl_opengl3.cpp
        ${DIR_INCLUDES}/imgui/imgui_draw.cpp
        ${DIR_INCLUDES}/imgui/imgui_demo.cpp
        ${DIR_INCLUDES}/imgui/imgui_tables.cpp
        ${DIR_INCLUDES}/imgui/imgui_widgets.cpp)

add_executable(mRender
        src/glad.c
        src/Main.cpp src/core/String.h src/core/String.cpp
        src/core/MAssert.h src/core/MBaseException.h
        src/core/Log.h
        src/math/Angle.h src/math/MathUtils.h
        src/math/Matrix4x4.h src/math/Matrix4x4.cpp
        src/math/MatrixN.h src/math/MatrixN.cpp
        src/math/Vector2.h src/math/Vector2.cpp
        src/math/Vector3.h src/math/Vector3.cpp
        src/core/Object.h src/core/Object.cpp
        src/core/FileUtil.h src/core/FileUtil.cpp
        src/core/IDrawUIable.h
        src/core/IRenderable.h
        src/constant/Properties.h
        src/materials/shader/Shader.h src/materials/shader/Shader.cpp
        src/materials/ShaderUtil.h src/materials/ShaderUtil.cpp
        src/core/Material.cpp src/core/Material.h
        src/core/BufferGeometry.h src/core/BufferGeometry.cpp
        src/core/Object3D.h src/core/Object3D.cpp
        src/geometries/BoxBufferGeometry.h src/geometries/BoxBufferGeometry.cpp
        src/geometries/ConeBufferGeometry.h src/geometries/ConeBufferGeometry.cpp
        src/objects/Scene.h src/objects/Scene.cpp
        src/objects/Camera.h src/objects/Camera.cpp
        src/objects/OrthoCamera.h src/objects/OrthoCamera.cpp
        src/objects/mesh/Triangle.h src/objects/mesh/Triangle.cpp
        src/objects/mesh/Model.h src/objects/mesh/Model.cpp
        src/objects/mesh/Cube.h src/objects/mesh/Cube.cpp
        src/gui/BaseGui.h src/gui/BaseGui.cpp
        src/renderer/MRender.h src/renderer/MRender.cpp
        src/test/Test.h src/test/Test.cpp
        src/test/CppExtendsTest.cpp
        src/test/TestObject.cpp
        src/math/Color.cpp src/math/Color.h
        src/gui/MainGui.cpp src/gui/MainGui.h src/geometries/SphereBufferGeometry.cpp src/geometries/SphereBufferGeometry.h
        src/geometries/AxiesBufferGeometry.h src/geometries/AxiesBufferGeometry.cpp
        src/objects/PerspCamera.cpp src/objects/PerspCamera.h
        src/helpers/GridHelper.cpp src/helpers/GridHelper.h
        src/helpers/OrthoCameraHelper.cpp src/helpers/OrthoCameraHelper.h
        )
INCLUDE_DIRECTORIES(${DIR_INCLUDES})
link_directories(${PROJECT_SOURCE_DIR}/lib)
target_link_libraries(mRender ${PROJECT_SOURCE_DIR}/lib/glfw3.dll imgui)